<%@ page import="com.tucue.model.Activity" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>园区活动新建编辑</title>
<link rel="stylesheet" type="text/css" href="<% request.getContextPath();%>/css/jquery.dataTables.css"/>
<link rel="stylesheet" href="<% request.getContextPath();%>/css/bootstrap.min.css"/>
<link rel="stylesheet" href="<% request.getContextPath();%>/css/commonStyle.css"/>
<style type="text/css" class="init"></style>
<script src="<% request.getContextPath();%>/js/jquery-1.11.2.min.js"></script>
<script src="<% request.getContextPath();%>/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<% request.getContextPath();%>/js/jquery.dataTables.js"></script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() 
{
	$('#example').dataTable();
	
} );
</script>
  <!--  Text Editor begin  -->
  <script charset="utf-8" src="<% request.getContextPath();%>/js/kindeditor/kindeditor-min.js"></script>
  <script charset="utf-8"  src="<% request.getContextPath();%>/js/kindeditor/lang/zh_CN.js"></script>
  <script>
    var editor;
    KindEditor.ready(
            function(K)
            {
              editor = K.create('textarea[name="texteditor_con"]',
                      {
                        allowFileManager : true ,
                        resizeType:0
                      }
              );

            }
    );
	$(document).ready(function(e) {
        $("#name").blur(function(){
					var name=$.trim($("#name").val()); 
					if(name.length>18){
						$("#letterP").html("<span>&nbsp;最多18个汉字</span>")
										   .css("color","red"); 
					}
					else if(name.length<1){
						$("#letterP").html("<span>&nbsp;标题不能为空</span>")
										   .css("color","red"); 
					}
					else{
						$("#letterP").html("<span>最多18个汉字</span>")
										   .css("color","black"); 
						}
				});

s
    });
  </script>
  <!--  Text Editor end  -->
</head>

<body>
<div class="container" style="margin:0px; width:1052px;">
  <div class="row show-grid">
    <h3 class="Page_title">园区活动新建/编辑</h3>
  </div>
  <div class="row show-grid unified-border" >
    <form class="form-horizontal" enctype="multipart/form-data" action="/${addOrUpdate}/Activity?categoryStr=1" method="post">
      <!--         编号-->
      <div class="form-group">
        <label for="num" class="col-sm-2 control-label">编号</label>
        <div class="col-xs-4">
          <input type="text" class="form-control" id="num" placeholder="#1000521" value="${activities.activityid}"/>
        </div>
      </div>
      <!--          名称-->
      <div class="form-group">
        <label for="name" class="col-sm-2 control-label">名称</label>
        <div class="col-xs-4">
          <input type="text" class="form-control" id="name" placeholder="*****资讯标题" value="${activities.name}">
        </div>
        <p class="help-inline" style="margin-top: 8px;" id="letterP">最多18个汉字</p>
      </div>
      <!--          类型 -->
      <div class="form-group">
        <label for="kind" class="col-sm-2 control-label">类型</label>
        <div class="col-xs-4">
          <select id="kind" class="form-control">
            <option selected value="不限">不限</option>
            <option value="路演活动">路演活动</option>
            <option value="创业分享">创业分享</option>
            <option value="行业交流">行业交流</option>
            <option value="其他">其他</option>
          </select>
        </div>
      </div>
      <!--          活动时间-->
      <div class="form-group">
        <label for="acttime" class="col-sm-2 control-label">活动时间</label>
        <div class="col-xs-4">
          <input type="date" class="form-control datetime-local" id="acttime" value="${activities.createtime}">
        </div>
      </div>
      <!--          报名时间-->
      <div class="form-group">
        <label for="regtime" class="col-sm-2 control-label">报名截止时间</label>
        <div class="col-xs-4">
          <input type="date" class="form-control datetime-local" id="regtime" value="${activities.enddatetime}">
        </div>
      </div>
      <!--          参会人数上限-->
      <div class="form-group">
        <label for="name" class="col-sm-2 control-label">参会人数上限</label>
        <div class="col-xs-4">
          <input type="text" class="form-control" id="name" placeholder="无" value="${activities.numberlimitation}">
        </div>
        <label>
          <input type="checkbox">
          需要资格审核</label>
      </div>
      <!--          活动地点-->
      <div class="form-group">
        <label for="loc" class="col-sm-2 control-label">活动地点</label>
        <div class="col-xs-4">
          <input type="text" class="form-control" id="loc" value="${activities.location}">
        </div>
      </div>
      <!--          活动费用-->
      <div class="form-group">
        <label for="cost" class="col-sm-2 control-label">活动费用</label>
        <div class="col-xs-4">
          <input type="text" class="form-control" id="cost"  value="${activities.cost}">
        </div>
        <label style="margin-top:10px;">元</label>
      </div>
      <!--          活动状态-->
      <div class="form-group">
        <label for="num" class="col-sm-2 control-label">活动状态</label>
        <div class="col-xs-4">
          <select id="state" class="form-control">
            <option selected value="不限">不限</option>
            <option value="预告">预告</option>
            <option value="进行中">进行中</option>
            <option value="已结束">已结束</option>
            <option value="取消">取消</option>
          </select>
        </div>
      </div>
            <!--          附件-->
      <div class="form-group">
        <label for="Source1" class="col-sm-2 control-label">添加附件</label>
        <div class="col-xs-4">
          <input name="files" class="btn btn-default" type="file" id="Source1">
        </div>
      </div>
      <!--          文本编辑器-->
      <div class="form-group">
        <label class="col-sm-2 control-label">正文</label>
        <div id="tro" class="col-sm-5" style="margin-top:10px; margin-left:14px;">
          <textarea name="texteditor_con" style=" display:block;width:700px;height:450px; margin-left:0px;">${activities.content}</textarea>
        </div>
      </div>
      <div class="buttongroup">
        <button type="button" class="btn btn-primary" id="p_savech">保存为草稿</button>
        <button type="button" class="btn btn-primary" id="p_saveup">保存并上线</button>
        <button type="button" class="btn btn-primary" id="p_savenone" style="width:96px;">取消</button>
      </div>
      <!-- 保存为草稿的弹窗 开始 -->
      <div id="Popups_savech" class="Popup_out_st">
        <div id="Con_box_savech" class="Popup_in_st">
          <img src="../images/close.png" id="closePopups_savech" class="Close_Popups"/>
          <label class="Popup_label">保存为草稿</label>
          <hr class="Popup_in_hr"/>
          <p class="Popup_in_p">保存修改内容？</p>
          <button type="submit" class="btn btn-primary" id="Popups_saveyes" style="width: 60px;margin-left: 80px;margin-top: 8px;float: left;">是</button>
          <button class="btn btn-primary" id="Popups_saveno" style="margin-left: 50px;margin-top: 8px;width: 60px;float: left;">否</button>
        </div>
      </div>
      <!-- 保存为草稿弹窗 结束 -->
      <!-- 保存并上线弹窗 开始 -->
      <div id="Popups_saveup" class="Popup_out_st">
        <div id="Con_box_saveup" class="Popup_in_st">
          <img src="../images/close.png" id="closePopups_saveup" class="Close_Popups"/>
          <label class="Popup_label">保存并上线</label>
          <hr class="Popup_in_hr"/>
          <p class="Popup_in_p">保存修改内容并发布上线？</p>
          <button type="submit" class="btn btn-primary" id="Popups_saveupyse" style="width: 60px;margin-left: 80px;margin-top: 8px;float: left;">是</button>
          <button class="btn btn-primary" id="Popups_saveupno" style="margin-left: 50px;margin-top: 8px;width: 60px;float: left;">否</button>
        </div>
      </div>
      <!-- 保存并上线弹窗 结束 -->
      <!-- 取消弹窗 开始 -->
      <div id="Popups_savenone" class="Popup_out_st">
        <div id="Con_box_savenone" class="Popup_in_st">
          <img src="../images/close.png" id="closePopups_savenone" class="Close_Popups"/>
          <label class="Popup_label">取消</label>
          <hr class="Popup_in_hr"/>
          <p class="Popup_in_p">确定放弃当前文案修改？</p>
          <button type="reset" class="btn btn-primary" id="Popups_savenoneyse" style="width: 60px;margin-left: 80px;margin-top: 8px;float: left;">是</button>
          <button class="btn btn-primary" id="Popups_savenoneno" style="margin-left: 50px;margin-top: 8px;width: 60px;float: left;">否</button>
        </div>
      </div>
      <!-- 取消弹窗 结束 -->
    </form>
  </div>
</div>
<script type="text/javascript">
  wdh=$(window).width();
  left=(wdh-330)/2;
  www=$(document).width();
  hhh=$(document).height();
  $(document).ready(function(){
    //保存为草稿
    $("#p_savech").click(function(){
      $("#Popups_savech").fadeIn("slow");
      $("#page_index").css('overflow','scroll');
      $("#page_index").css('overflow','hidden');
      $("#Con_box_savech").css('margin-left',left);
      $("#Con_box_savech").css('margin-top','770px');
    });
    $("#closePopups_savech").click(function(){
      $("#Popups_savech").fadeOut("slow");
      $("#page_index").css('overflow-y','auto');
    });
    $("#Popups_saveyes").click(function(){
      $("#Popups_savech").fadeOut("slow");
      $("#page_index").css('overflow-y','auto');
    });

    $("#Popups_saveno").click(function(){
      $("#Popups_savech").fadeOut("slow");
      $("#page_index").css('overflow-y','auto');
    });

    //保存并上线
    $("#p_saveup").click(function(){
      $("#Popups_saveup").fadeIn("slow");
      $("#page_index").css('overflow','scroll');
      $("#page_index").css('overflow','hidden');
      $("#Con_box_saveup").css('margin-left',left);
      $("#Con_box_saveup").css('margin-top','770px');
    });
    $("#closePopups_saveup").click(function(){
      $("#Popups_saveup").fadeOut("slow");
      $("#page_index").css('overflow-y','auto');
    });

    $("#Popups_saveupyse").click(function(){
      $("#Popups_saveup").fadeOut("slow");
      $("#page_index").css('overflow-y','auto');
    });

    $("#Popups_saveupno").click(function(){
      $("#Popups_saveup").fadeOut("slow");
      $("#page_index").css('overflow-y','auto');
    });

    //取消
    $("#p_savenone").click(function(){
      $("#Popups_savenone").fadeIn("slow");
      $("#page_index").css('overflow','scroll');
      $("#page_index").css('overflow','hidden');
      $("#Con_box_savenone").css('margin-left',left);
      $("#Con_box_savenone").css('margin-top','770px');
    });
    $("#closePopups_savenone").click(function(){
      $("#Popups_savenone").fadeOut("slow");
      $("#page_index").css('overflow-y','auto');
    });

    $("#Popups_savenoneyse").click(function(){
      $("#Popups_savenone").fadeOut("slow");
      $("#page_index").css('overflow-y','auto');
    });

    $("#Popups_savenoneno").click(function(){
      $("#Popups_savenone").fadeOut("slow");
      $("#page_index").css('overflow-y','auto');
    });

    $("#page_index ").css('width',www);
  });


  $(window).resize(function(){
    wdh=$(window).width();
    left=(wdh-330)/2;
    www=$(document).width();
    //保存为草稿
    $("#Con_box_savech").css('margin-left',left);
    $("#Con_box_savech").css('margin-top','770px');
    //保存并上线
    $("#Con_box_saveup").css('margin-left',left);
    $("#Con_box_saveup").css('margin-top','770px');
    //取消
    $("#Con_box_savenone").css('margin-left',left);
    $("#Con_box_savenone").css('margin-top','770px');

    $("#page_index ").css('width',www);
  });
</script>
</body>
</html>